#ifndef SYSTEM_CONFIG_H
#define SYSTEM_CONFIG_H



//--------------------------------------------------------------------------------------------
//Define MCU/SOC type.
//Select one of following macros to determin MCU/SOC type.
//--------------------------------------------------------------------------------------------
//
//#define STC8A4K16S2A12
//#define STC8A4K32S2A12
//#define STC8A4K60S2A12
//#define STC8A4K64S2A12
//#define STC8A8K16S4A12
//#define STC8A8K32S4A12
//#define STC8A8K60S4A12
//#define STC8A8K64S4A12
//#define STC8F1K08
//#define STC8F1K08S2
//#define STC8G1K08P20
//#define STC8G1K12P20
//#define STC8G1K17P20
//#define STC8G1K08P8
//#define STC8G1K12P8
//#define STC8G1K08A
//#define STC8G1K17A
//#define STC8G2K16S2
//#define STC8G2K32S2
//#define STC8G2K60S2
//#define STC8G2K60S4
//#define STC8G2K64S4
//#define STC8H1K08
//#define STC8H1K12
//#define STC8H1K17
//#define STC8H1K16
//#define STC8H1K24
//#define STC8H1K28
#define STC8H3K32S4
//#define STC8H3K64S4
//#define STC8H8K32S4U
//#define STC8H8K64S4U
//#define STC12C5A60S2
//#define STC12C5A60AD
//#define STC12LE5A60AD
//#define STC12LE5A60S2
//#define SC92F7320
//#define SC92F7321
//#define SC92F7322
//#define SC92F7323
//#define SC92F7250
//#define SC92F7251
//#define SC92F7252
//#define SC92F7350
//#define SC92F7351
//#define SC92F7352
//#define N76E003
//#define AT89S51	//not supported yet
//#define AT89S52	//not supported yet
//#define AT89S53	//not supported yet
//--------------------------------------------------------------------------------------------



//--------------------------------------------------------------------------------------------
//define basic frequency of system clock.
//--------------------------------------------------------------------------------------------
#if defined(N76E003)
//#define FOSC					16000000UL
#define FOSC					16600000UL	//To generate accurate 115200 baudrate, it is better to set this value by call macro MODIFY_HIRC_166(). Strongly recommend!!!
#elif defined(SC92F732X)
#define FOSC					12000000UL
#else
#define FOSC					24000000UL
//#define FOSC					18432000UL
#endif
//--------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------
//define event container data type which determines the numbers of event.
//Values:
// 0				the type of event container is unsigned char
// 1				the type of event container is unsigned short
// 2				the type of event container is unsigned int
// 3				the type of event container is unsigned long
// 4				the type of event container is unsigned long long
//--------------------------------------------------------------------------------------------
#define EVENT_RECORD_TYPE					2
//--------------------------------------------------------------------------------------------

#define EVENT_MAX_COUNT															16


//--------------------------------------------------------------------------------------------
//define soft timer record type which determines the period of time.
//Values:
// 0				the type of event container is unsigned char
// 1				the type of event container is unsigned short
// 2				the type of event container is unsigned int
// 3				the type of event container is unsigned long
// 4				the type of event container is unsigned long long
//--------------------------------------------------------------------------------------------
#define SOFT_TIMER_RECORD_TYPE		2
//--------------------------------------------------------------------------------------------

#define SOFT_TIMER_MAX_COUNT													16

//--------------------------------------------------------------------------------------------
//define the buffer size of UART0's receiver.
//Values: range from 2 to 255, 2 and 255 are included.
//Note:
//  kernel will reserves some bytes of RAM to maintain this soft timer resorces. The capcable is
//depends on what the value is. It may use either data, idata, or xdata memory which depends on
//memory prefix attribute to the specific variable in soft_timer.c.
//--------------------------------------------------------------------------------------------
#define UART0_RX_BUFFER_SIZE				64
//--------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------
//define the buffer size of UART1's receiver.
//Values: range from 2 to 255, 2 and 255 are included.
//Note:
//  kernel will reserves some bytes of RAM to maintain this soft timer resorces. The capcable is
//depends on what the value is. It may use either data, idata, or xdata memory which depends on
//memory prefix attribute to the specific variable in soft_timer.c.
//--------------------------------------------------------------------------------------------
#define UART1_RX_BUFFER_SIZE				64
//--------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------
//define the buffer size of UART2's receiver.
//Values: range from 2 to 255, 2 and 255 are included.
//Note:
//  kernel will reserves some bytes of RAM to maintain this soft timer resorces. The capcable is
//depends on what the value is. It may use either data, idata, or xdata memory which depends on
//memory prefix attribute to the specific variable in soft_timer.c.
//--------------------------------------------------------------------------------------------
#define UART2_RX_BUFFER_SIZE				64
//--------------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------------
//define the buffer size of UART3's receiver.
//Values: range from 2 to 255, 2 and 255 are included.
//Note:
//  kernel will reserves some bytes of RAM to maintain this soft timer resorces. The capcable is
//depends on what the value is. It may use either data, idata, or xdata memory which depends on
//memory prefix attribute to the specific variable in soft_timer.c.
//--------------------------------------------------------------------------------------------
#define UART3_RX_BUFFER_SIZE				64
//--------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------
//configure uartx's baudrate generator source.
//Values:
// 0		use timer0 as baudrate generator.
// 1		use timer1 as baudrate generator.Available for STC,N76E003,SC92F732X
// 2		use timer2 as baudrate generator.Available for STC,SC92F732X
// 3		use timer3 as baudrate generator.Available for N76E003
// 4		use timer4 as baudrate generator.
// -1		do not need timer as baudrate generator
//--------------------------------------------------------------------------------------------
#define UART0_BAUDRATE_GENERATOR				2
//--------------------------------------------------------------------------------------------



//--------------------------------------------------------------------------------------------
//configure uart0's baudrate generator source.
//Values:
// 0		use timer0 as baudrate generator.
// 1		use timer1 as baudrate generator.
// 2		use timer2 as baudrate generator.Available for STC
// 3		use timer3 as baudrate generator.Available for N76E003
// 4		use timer4 as baudrate generator.
// -1		do not need timer as baudrate generator
//--------------------------------------------------------------------------------------------
#define UART1_BAUDRATE_GENERATOR				2
//--------------------------------------------------------------------------------------------



//--------------------------------------------------------------------------------------------
//configure uart0's baudrate generator source.
//Values:
// 0		use timer0 as baudrate generator
// 1		use timer1 as baudrate generator
// 2		use timer2 as baudrate generator.Available for STC
// 3		use timer3 as baudrate generator.Available for STC
// 4		use timer4 as baudrate generator
// -1		do not need timer as baudrate generator
//--------------------------------------------------------------------------------------------
#define UART2_BAUDRATE_GENERATOR				2	//STC
//--------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------
//configure uart0's baudrate generator source.
//Values:
// 0		use timer0 as baudrate generator
// 1		use timer1 as baudrate generator
// 2		use timer2 as baudrate generator.Available for STC
// 3		use timer3 as baudrate generator.
// 4		use timer4 as baudrate generator.Available for STC
// -1		do not need timer as baudrate generator
//--------------------------------------------------------------------------------------------
#define UART3_BAUDRATE_GENERATOR				2	//STC
//--------------------------------------------------------------------------------------------


																
#endif /* SYSTEM_CONFIG_H */
